SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 49835: Interpolated value can be wrong when RLAG function uses a lagged value before the base date

DetailsAboutRate It

The RLAG function is used in PROC COMPILE methods, which in turn, are used in SAS® Risk Dimensions®. If the requested lag matches a date in the time grid for risk factor RFX, there is no problem. For example, if the only call to RLAG for RFX is

RLAG( rfx, 2, "day" )
and "2 day" is in the time grid of risk factor RFX, there is no problem.

When SAS Risk Dimensions computes a lag, it tries to use base-case data. However, it can fail to use perturbed values when lagging. If the RLAG function requests a lagged value that is not in the risk factor's time grid, an interpolation is performed. The problem can occur when you use a date that is before the base date, and the resulting interpolated value might be incorrect.

The problem can occur when the lagged date is before the base date and the time grid step immediately before the base date. In a non-simulation, the problem would occur if the lagged date is between the base date and first time grid step prior to the base case. For example, in a scenario analysis if RLAG has an interval more recent than the first time grid entry. In a simulation, the manifestation might be more subtle. Suppose

  • the base date is Jan 10,
  • the _date_ for a horizon is Jan 12,
  • the time grid for risk factor my_rf would look to Jan 11 and Jan 8, and
  • a method calls rlag(my_rf, 3, "day"), which expects the value of my_rf on Jan 9.
Jan 9 is between the base date (Jan 10) and the first time grid step prior to the base case (Jan 8). In both cases, SAS Risk Dimensions would interpolate by using the base-case value of the risk factor instead of the perturbed value.

The workaround is to avoid using intervals that cause this problem. Note that intervals can be added to the time grid.

Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Risk Dimensions Enterprise EditionMicrosoft® Windows® for x645.56.19.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 Datacenter Edition5.56.19.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 Enterprise Edition5.56.19.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 Standard Edition5.56.19.3 TS1M29.4 TS1M0
Microsoft Windows Server 2003 for x645.56.19.3 TS1M29.4 TS1M0
Microsoft Windows Server 20085.56.19.3 TS1M29.4 TS1M0
Microsoft Windows Server 2008 for x645.56.19.3 TS1M29.4 TS1M0
Microsoft Windows XP Professional5.56.19.3 TS1M29.4 TS1M0
Windows 7 Enterprise 32 bit5.56.19.3 TS1M29.4 TS1M0
Windows 7 Enterprise x645.56.19.3 TS1M29.4 TS1M0
Windows 7 Home Premium 32 bit5.56.19.3 TS1M29.4 TS1M0
Windows 7 Home Premium x645.56.19.3 TS1M29.4 TS1M0
Windows 7 Professional 32 bit5.56.19.3 TS1M29.4 TS1M0
Windows 7 Professional x645.56.19.3 TS1M29.4 TS1M0
Windows 7 Ultimate 32 bit5.56.19.3 TS1M29.4 TS1M0
Windows 7 Ultimate x645.56.19.3 TS1M29.4 TS1M0
Windows Vista5.56.19.3 TS1M29.4 TS1M0
Windows Vista for x645.56.19.3 TS1M29.4 TS1M0
64-bit Enabled AIX5.56.19.3 TS1M29.4 TS1M0
64-bit Enabled HP-UX5.56.19.3 TS1M29.4 TS1M0
64-bit Enabled Solaris5.56.19.3 TS1M29.4 TS1M0
HP-UX IPF5.56.19.3 TS1M29.4 TS1M0
Linux5.56.19.3 TS1M29.4 TS1M0
Linux for x645.56.19.3 TS1M29.4 TS1M0
Solaris for x645.56.19.3 TS1M29.4 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.